package fr.enseirbmatmeca.apms.tapestry.pages;

import fr.enseirbmatmeca.apms.spring.security.ConstantRoleUserService;

public class Redirect extends Security{
	

	Object onActivate() {
		String role = getRole();
		
		if (role==null)
			return Index.class;		
		
  		if (role.equals(ConstantRoleUserService.ADMINISTRATOR)) 
   			return fr.enseirbmatmeca.apms.tapestry.pages.ListProjects.class;
  		else if (role.equals(ConstantRoleUserService.USER))
  				return fr.enseirbmatmeca.apms.tapestry.pages.MyProjects.class;
 		else 
     			return Index.class; 
  		
 
	} 
}
